#include "tDisplay.h"
#include"image.h"
#include"DrawImage.h"
#include"Continent.h"
#include<string>
#include<vector>
#include<stdlib.h>
using namespace std;

vector<int>List ;
extern pair < Image *, int> Questions[11];
extern string c_num_to_name[6] ;

Continent::Continent(void)
{
	tt = new tDisplay();
}

void Continent::newContinent(int n)
{
	//string name = c_num_to_name[n];
	tt->displayLoad(0);
	List.clear();
	for ( int i=1 ; i<=10 ; i++ )
		List.push_back(i);
	char x[11] ;
	string name="";
	if(n==1)	name="africa";
	else if(n==2) name="asia";
	else if(n==3) name="europe";
	else if(n==4) name="nam";
	else if(n==5) name="sam";
	string photo_name , photo_num ;
	for ( int i=0 ; i<7 ; i++ )
	{
		if ( i == 1 ) tt->displayLoad(1);
		if ( i == 3 ) tt->displayLoad(2);
		if ( i == 5 ) tt->displayLoad(3);
		int ind = rand()%List.size() ;
		photo_name = name ;
		sprintf(x,"%d",ind);
		photo_num = x ;
		Questions[i].first = new Image(photo_name + "_" + photo_num + ".bmp");
		List.erase( List.begin()+ind );
	}
	tt->displayLoad(0);
}


void Continent::showQuestion ( int q_num , int score , int cnum)
{
	tt->dispalyQuestion(q_num,score,cnum);
}